// @Author miaoqing
// @Date 2024/03/01 11:12:00
// @Desc
package common

import (
	"os/user"
	"strings"
)

const (
	Online_Topic = "Online_Topic"
)

func getUser() string {
	var userName string
	u, err := user.Current()
	if err != nil {
		userName = "unknow"
	} else {
		userName = u.Username
	}
	// windows用户名带有域(例如:TAOMEE-EX\chet)只保留用户名
	sl := strings.Split(userName, "\\")
	userName = sl[len(sl)-1]
	return userName
}
